package com.mmf.ancientcostume.presenter.imp.goods;

import android.util.Log;

import com.mmf.ancientcostume.activity.CommentListActivity;
import com.mmf.ancientcostume.base.presenter.BasePresenter;
import com.mmf.ancientcostume.service.home.HomeService;

import java.util.Map;

import okhttp3.RequestBody;
import rx.Subscription;
import rx.functions.Action1;

/**
 * Created by MMF on 2017-10-20.
 */

public class AddCommentPresenterImp extends BasePresenter<CommentListActivity>  {
    private HomeService mHomeService;
    public AddCommentPresenterImp() {
        mHomeService = new HomeService();
    }


    public void insertComment(Map<String, Object> params, Map<String, RequestBody> bodyMap) {
        showLoadingDialog();
        Subscription subscription =
                mHomeService.insertComment(params,bodyMap).doOnNext(new Action1<String>() {
                    @Override
                    public void call(String remindDTOs) {
                        System.out.println(remindDTOs.toString());
                    }
                }).subscribe(newSubscriber(new Action1<String>() {
                    @Override
                    public void call(String remindDTOs) {
                        Log.e("********test","111111");
                    }
                }));
        mCompositeSubscription.add(subscription);
    }

}
